home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 6
/
FM Towns Free Software Collection 6.iso
/
t_os
/
cutf
/
asm
/
head6
< prev
next >
Wrap
Text File
|
1993-07-08
|
6KB
|
393 lines
;
.386p
;G_BIOS equ 110h
;VRAM equ 120h
MOUSE equ fword ptr fs:[40h]
EGB equ fword ptr fs:[20h]
MOUSE1 equ fword ptr fs:[48h]
SOUND equ fword ptr fs:[80h]
RAM0 MACRO aaa
YOMU aaa,56
ENDM
RAM1 MACRO aaa
YOMU aaa,60
ENDM
RAM2 MACRO aaa
YOMU aaa,64
ENDM
RAM3 MACRO aaa
YOMU aaa,68
ENDM
AFRE MACRO aaa
YOMU aaa,72
ENDM
AKI MACRO aaa
YOMU aaa,76
ENDM
YOMU MACRO aaa,bbb
push esi
call look_me
mov esi,4[esi]
mov aaa,bbb[esi]
pop esi
ENDM
KAKU MACRO aaa,bbb
push esi
call look_me
mov esi,4[esi]
mov aaa[esi],bbb
pop esi
ENDM
WD_WANT MACRO
mov ah,4 ;ウインドウの要求
call look_me
call komei
ENDM
BOOK MACRO
call look_me
mov esi,4[esi]
ENDM
BOX MACRO aaa,bbb
call aaa
mov cx,bbb
call putbox
ENDM
GO_P MACRO aaa
call aaa
jmp p_call
ENDM
WD_CLS MACRO aaa
mov ah,100
mov al,10 ;[ah]=100::[cl]=[s_no]::[bx]=[wd_no]
mov cl,aaa
call komei1
ENDM
WD_MV MACRO aaa
call look_me
mov ah,100
mov al,28
mov cx,aaa
call komei1
ENDM
MOZI MACRO aaa
call aaa
call putmozi
ENDM
MOZI1 MACRO aaa
call aaa
mov ah,100
mov al,17
call komei1
ENDM
MOZI2 MACRO aaa
call aaa
mov ah,100
mov al,19
call komei1
ENDM
WD_ERZ MACRO aaa
mov ah,100
mov al,18 ;[ah]=10:[bx]=[wd_no] [cl]=[s_no]
mov cl,aaa ;18 = wind erase
call komei1
ENDM
WD_LEFT MACRO
call look_me
mov edi,esi
mov ah,19 ;wind left bx=wind no
call komei1
mov ah,16 ;relese of mouse
mov al,5
call komei1
ENDM
SET_P MACRO aaa
call aaa
call p_set
ENDM
CALL_P MACRO aaa
call aaa
call p_call
ENDM
MOU MACRO aaa,bbb
call aaa
mov cx,bbb
mov ah,100
mov al,23
call komei1
ENDM
GAMEN MACRO aaa
mov bx,aaa
mov al,1
mov ah,25
call komei
ENDM
DEKASA MACRO aaa,bbb,ccc
mov bx,aaa
mov dx,bbb
mov cx,ccc
mov ah,25
mov al,3
call komei
ENDM
M_P_CALL MACRO
add edi,2
mov ah,20
call komei
mov ah,21
jmp komei
ENDM
M_P_SET MACRO
push edi
add edi,2
mov ah,20
call komei
pop edi
mov [edi],bx
ret
ENDM
M_LOAD MACRO
mov ah,200 ; edi load banchi
mov al,4 ; edx file name
jmp komei
ENDM
M_SAVE MACRO
mov ah,200 ; edx file name
mov al,5 ; edi data banchi
jmp komei ; ecx byte su
ENDM
M_BYTESU MACRO
mov ah,200 ;edx file name
mov al,6
jmp komei
ENDM
M_PUT_E MACRO
call look_me
mov bx,10[esi]
mov 8[edi],bx
mov ah,100
mov al,20
jmp komei
ENDM
M_MATUMS MACRO
mov ah,16
mov al,2
jmp komei
ENDM
M_KESUMS MACRO
mov ah,16
mov al,5
jmp komei
ENDM
M_KENMS MACRO
mov ah,16
mov al,1
jmp komei
ENDM
M_ZZZ MACRO
push edi
push esi
call look_me ;mov edi,bf_egb
mov esi,4[esi]
mov edi,20[esi]
pop esi
call EGB
pop edi
ret
ENDM
M_S_XOR MACRO
push ax
call p_xor
mov ax,[esp]
call b_xor_in
call p_xor
pop ax
ret
ENDM
M_P_XOR MACRO
call look_me
add esi,10 ; lea esi,wd_no
mov ax,[esi]
call b_xor_dt ;lea edi,xor box data
mov [edi],ax
mov ah,100
mov al,15
jmp komei
ENDM
code segment
assume cs:code,ds:code,gs:code,es:code,ss:code
org 0
start proc
lea eax,sz1
lea ecx,sz2
sub ecx,eax
inc ecx
mov file_byte,ecx
lea eax,sz1
mov bf_file,eax
lea eax,ds_name
mov ban_fname,eax
call filecreate
call writefile
call fileclose
owari:
mov ah,4ch
int 21h
bf_file dd ?
file_byte dd ?
ban_fname dd ?
handle dw ?
ck_handle dw ?
fileopen:
mov ck_handle,0
mov ah,3dh
mov edx,ban_fname
mov al,2
int 21h
jc short cantopen
mov handle,ax
ret
cantopen:
cmp ax,2
je short filecreate
cantopen1:
mov ck_handle,1
ret
filecreate:
mov ck_handle,0
mov ah,3ch
mov edx,ban_fname
mov ecx,0
int 21h
jc cantopen1
mov handle,ax
ret
fileclose:
mov bx,handle
mov ah,3eh
int 21h
ret
readfile:
mov ck_handle,0
mov bx,handle
mov edx,bf_file
mov ecx,file_byte
mov ah,3fh
int 21h
jc cantopen1
ret
writefile:
mov ck_handle,0
mov bx,handle
mov edx,bf_file
mov ecx,file_byte
mov ah,40h
int 21h
jc cantopen1
ret
sz1 label dword
cmp ah,0 ;ah=0 システムにリンクする
je link
cmp ah,1
je re_paint
cmp ah,2 ;=2 ウインドの初期化
je paint_wd
cmp ah,4 ;マウスが押された
je mouse_in
cmp ah,6
je be_called
ret
link:
call look_me
mov [esi],ecx
mov 4[esi],edx
ret
putbox:
mov ah,2
mov al,0
call MOUSE
mov ah,100
mov al,14
call komei1
mov ah,2
mov al,1
call MOUSE
ret
putmozi:
;edi = mozi data head
mov ah,100
mov al,12
komei1: ;window 番号を必要とするコマンド bx=window no.
push esi
call look_me
mov bx,10[esi]
pop esi
komei: ;window 番号が必要でないコマンド
push esi
call look_me
mov esi,[esi]
xchg esi,[esp]
ret ; jmp komei
sub_edi:
pop edi
ret
sub_esi:
pop esi
ret
sub_edx:
pop edx
ret
sub_ecx:
pop ecx
ret